package com.longchen.mall.config.exception;

import com.longchen.mall.common.ResultCode;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author xbfinal
 * @Package com.longcehng.mall.config.exception
 * @Date 2024/7/14 10:13
 * 描述 :
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class MallException extends RuntimeException{

    private static final long serialVersionUID = -5627539010744055926L;
    private Integer code;//状态码
    private String msg;//异常信息

    public MallException(String msg){
        this.code= ResultCode.ERROR;
        this.msg=msg;
    }
    public MallException(String msg,Integer code){
        this.code= ResultCode.ERROR;
        this.msg=msg;
    }
}
